<%@ page import="com.ym.utils.StringHandler" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
    long uid = StringHandler.getLong(request.getParameter("uid"));
%>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>用户交易流水</title>
    <%@ include file="/WEB-INF/view/common/includ-css.jsp" %>
</head>
<body class="gray-bg">
<div class="row wrapper border-bottom white-bg">
    <div class="col-sm-12">
        <div class="ibox float-e-margins" style="margin-bottom: 0px;">
            <div class="ibox-title">
                <h5>查询条件</h5>
                <div class="ibox-tools">
                    <a class="collapse-link">
                        <i class="fa fa-chevron-up"></i>
                    </a>
                </div>
            </div>
            <div class="ibox-content">
                <form class="form-inline">
                    <div class="form-group">
                        <label class="font-normal">用户id：</label>
                        <input type="text" id="uid" name="uid" placeholder="用户id" value="<%=uid%>"/>
                    </div>
                    <div class="form-group">
                        <label class="font-normal">alias：</label>
                        <input type="text" id="alias" name="alias" placeholder="alias" />
                    </div>
                    <div class="form-group">
                        <label class="font-normal">状态：</label>
                        <select class="form-control" id="status">
                            <option value="-1">全部</option>
                            <option value="0">删除</option>
                            <option value="1">正常</option>
                        </select>
                    </div>
                    <button type="button" class="btn btn-white btn-info btn-round" style="margin-bottom: 0px;" id="query">
                        <i class="ace-icon fa fa-search bigger-120 blue"></i>查询
                    </button>
                </form>
            </div>
        </div>
    </div>
</div>
<div class="row wrapper border-bottom white-bg page-heading">
    <div class="col-sm-4">
        <h2>用户好友列表</h2>
    </div>
</div>

<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">

                <div class="ibox-content">
                    <table id="dataTables" class="table table-striped table-bordered table-hover">
                        <thead>
                        <tr>
                            <th>好友id</th>
                            <th>好友昵称</th>
                            <th>备注名称</th>
                            <th>备注描述</th>
                            <th>状态</th>
                        </tr>
                        </thead>
                        <tbody></tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>
<div class="row wrapper border-bottom white-bg page-heading">
    <div class="col-sm-4">
        <button type="button" class="btn btn-white btn-info btn-round" style="margin-bottom: 0px;" onclick="history.back();">
            返回
        </button>
    </div>
</div>
<%@ include file="/WEB-INF/view/common/includ-js.jsp" %>
<!-- Data Tables -->
<script src="${path}/static/Hui/js/plugins/dataTables/jquery.dataTables.js"></script>
<script src="${path}/static/Hui/js/plugins/dataTables/dataTables.bootstrap.js"></script>
<script src="${path}/static/plugins/layui/layui.all.js"></script>
<script>
    $(function(){

        // 关闭错误提示
        $.fn.dataTable.ext.errMode = 'none';

        // 数据表格
        var tables = $("#dataTables").dataTable({
            paging:true,
            serverSide: true,
            searching: false,
            ordering:  false,
            processing: false,
            "lengthMenu": [10, 20, 50, 100],
            pageLength: 20,
            lengthChange: true,
            "ajax":{
                url:"/app/user/friend/list",
                type:"post",
                data: function (d) {
                    d.uid=$("#uid").val(),
                    d.alias = $("#alias").val(),
                    d.status = $("#status").val()
                }
            },
            columns: [
                { "data": "friend_id" },
                { "data": "nickName" },
                { "data": "friend_remark" },
                { "data": "friend_desc" },
                { "data": "status" },
            ],
            columnDefs: [
                {
                    "render": function(data, type, row, meta) {
                        if(data){
                            return "正常";
                        }
                        return "删除";
                    },
                    "targets": 4
                },
            ]
        });
        $("#query").click(function(){
            tables.dataTable().fnDraw();
        });

    });

</script>
</body>
</html>
